package weekimwee.cn.x5nightdemo

import android.app.Activity
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_link.*

class LinkActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_link)
        submit.setOnClickListener {
            if(!title_et.text.isBlank()&&!url_et.text.isBlank()){
                setResult(Activity.RESULT_OK, Intent().putExtra("title",title_et.text.toString().trim()).putExtra("url",url_et.text.toString().trim()))
                finish()
            }
        }
    }
}
